package com.iris.egrant.service.formInit;

/*    */

import com.iris.egrant.app.dao.formInit.FormBaseLibraryDao;
import com.iris.egrant.dao.grantSetting.GrantSettingDao;
import com.iris.egrant.exception.DaoException;
import com.iris.egrant.exception.ServiceException;
import com.iris.egrant.model.formInit.FormBaseLibrary;
import com.iris.egrant.model.formInit.FormInitItem;
import com.iris.egrant.model.grantSetting.GrantSetting;
import com.iris.egrant.service.formInit.InitalizeReadService;
import com.iris.egrant.service.proposal.BaseXmlInitServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;


@Service("InitializeReadService")
@Transactional(propagation = Propagation.NOT_SUPPORTED, readOnly = true)
public class InitalizeReadServiceImpl
        extends BaseXmlInitServiceImpl
        implements InitalizeReadService {
    @Autowired
    private FormBaseLibraryDao formBaseLibraryDao;
    @Autowired
    private GrantSettingDao grantSettingDao;

    public FormBaseLibrary getFormBaseLibraryDao(Long formId) {
        /* 39 */
        return (FormBaseLibrary) this.formBaseLibraryDao.get(formId);
    }


    public List<Map<String, Object>> getRefreshList(String sqlcontent, List<Object> params) {
        /* 44 */
        return this.formBaseLibraryDao.getRefreshList(sqlcontent, params);
    }


    public FormBaseLibrary getFormBaseLibraryByFormId(Long formId) throws DaoException {
        /* 49 */
        return this.formBaseLibraryDao.getFormBaseLibraryByFormId(formId);
    }


    public FormBaseLibrary getFormBaseLibraryByFormCode(Long formId) throws DaoException {
        /* 54 */
        return this.formBaseLibraryDao.getFormBaseLibraryByFormCode(formId);
    }

    public List<FormInitItem> getFormInitItemListById(String ids) throws DaoException, ServiceException {
        /* 58 */
        return this.formBaseLibraryDao.getFormInitItemListById(ids);
    }


    public GrantSetting getGrantInfoByGrantNo(String subGrantNo) {
        /* 63 */
        return this.grantSettingDao.getGrantInfoByGrantNo(subGrantNo);
    }


    public GrantSetting getGrantInfoByGrantCode(Long grantCode) {
        /* 69 */
        return (GrantSetting) this.grantSettingDao.get(grantCode);
    }
}